package com.example.demo.huawei;

import java.util.Scanner;

/*
字符串分割转换
3
12abc-abCABc-4aB@
输出：12abc-abc-ABC-4aB-@

 */
public class OD52_2 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int k = sc.nextInt();
        sc.nextLine();

        String str = sc.nextLine();

        String[] split = str.split("-");
        // 保留第一个字串
        String head = split[0];
        StringBuilder sb = new StringBuilder();
        for (int i = 1; i < split.length; i++) {
            String s = split[i];
            sb.append(s);
        }
        System.out.println(sb);
        StringBuilder res = new StringBuilder();
        res.append(head);
        for (int i = 0; i < sb.length(); i += k) {
            String sub;
            if (i + k > sb.length()) {
                sub = sb.substring(i, sb.length());
            } else {
                sub = sb.substring(i, i + k);
            }
            if (countLowerCase(sub) == countUpperCase(sub)) {
                res.append("-").append(sub);
            } else if (countLowerCase(sub) > countUpperCase(sub)) {
                res.append("-").append(sub.toLowerCase());
            } else {
                res.append("-").append(sub.toUpperCase());
            }
            //            System.out.println(sub);
        }
        System.out.println(res);
    }

    private static int countLowerCase(String s) {
        int count = 0;
        for (char c : s.toCharArray()) {
            if (Character.isLowerCase(c)) {
                count++;
            }
        }
        return count;
    }

    private static int countUpperCase(String s) {
        int count = 0;
        for (char c : s.toCharArray()) {
            if (Character.isUpperCase(c)) {
                count++;
            }
        }
        return count;
    }
}
